Introduction

In this document I will be evaluating the residuals of models fit to data of various transformed power.

Create initial models

Data upload and transformation will be hidden.

Fit same model to all transformed datasets and visualize residuals.

ctrl <- lmeControl(opt = "optim", niterEM = 200, msTol = 1e-20, msMaxIter = 1000) # Same as above, shown for clarity

lmm3.sqrt <- lme(sqrty ~ conc*poly(t,degree=2,raw=TRUE),
                 correlation = corAR1(, form = ~ t | fishID),
                 random = reStruct(~poly(t,degree=2,raw=TRUE)|fishID,REML=FALSE,pdClass="pdSymm"),
                 method = "ML",
                 control = ctrl,
                 data = nest.L.sqrt)
lmm3.4rt <- lme(rty ~ conc*poly(t,degree=2,raw=TRUE),
                 correlation = corAR1(, form = ~ t | fishID),
                 random = reStruct(~poly(t,degree=2,raw=TRUE)|fishID,REML=FALSE,pdClass="pdSymm"),
                 method = "ML",
                 control = ctrl,
                 data = nest.L.4rt)
lmm3.log10 <- lme(logy ~ conc*poly(t,degree=2,raw=TRUE),
                 correlation = corAR1(, form = ~ t | fishID),
                 random = reStruct(~poly(t,degree=2,raw=TRUE)|fishID,REML=FALSE,pdClass="pdSymm"),
                 method = "ML",
                 control = ctrl,
                 data = nest.L.log10)

Evaluate the normality of the residuals for the subject specific and population averaged models. All transformations seem to have better fits when looking at subject level models (level=1).

Square root data appears to produce residuals that fall on the line of unity, but there is a high degree of skew towards large values. Other transformations produce more symmetric residuals, but with strange behavior.

Evaluate population averaged model residuals (level=0) by time period. There seems to be some amount of heteroscedacticity for all transformations with variance increasing with time. We may be able to deal with this. There is also an obvious decrease in skew with time. These graphics seem to show that residuals become most symmetric with decreasing power transformation. However the distributions of residuals by time become more variable.

Evaluate residuals relationship to concentration. It seems that at high concentration, where hypoactivity appears, model fits data poorly. hopefully this will not have an effect on the detection of chemical activity. Data appears to be fit to values lower than the true values taken. However, this could be due to a high level of skew in the data due to zero or near-zero values. Could error of the fits be used to evaluate chemical effect, haha.

Finally, evaluate residuals against fitted values. Looks terrible. All models appear to fitting high and low values very poorly. Is there a way to adjust for this?

Take-away I will be using square root transformed data. I also suspect that high and low values are being modeled poorly because a cubic polynomial more accurately fits the data.